package com.example.test4;

public class Demo4 {

    public static void main(String[] args) {

        print((s1) -> System.out.println(s1), "Hello");

        add((a, b) -> a + b, 2, 4);

    }

    private static void print(Print print, String msg) {
        print.printInfo(msg);
    }
    private static void add(MathAdd add, double a, double b) {
        double r = add.add(a, b);
        System.out.println(r);
    }
}
